package dbfactroy

import (
	"fmt"
)

type DbConfig struct {
	User     string
	Password string
	Host     string
	Port     int32
	DbName   string
	//dburl "root:leijmdas@163.comL@tcp(huawei.akunlong.top:13306)/%s?charset=utf8&mb4&parseTime=True&loc=Local",

}

func NewDbConfig() *DbConfig {
	return &DbConfig{}
}

func (dbConnInf *DbConfig) MakeDbUrl() (dburl string) {
	dburl = fmt.Sprintf("%s:%s@tcp(%s:%d)/%s?charset=utf8&mb4&parseTime=True&loc=Local",
		dbConnInf.User,
		dbConnInf.Password,
		dbConnInf.Host,
		dbConnInf.Port,

		dbConnInf.DbName)
	return
}
